<?php
/*
 * @Author: your name
 * @Date: 2020-11-10 17:19:06
 * @LastEditTime: 2020-12-11 10:30:38
 * @LastEditors: Please set LastEditors
 * @Description: 防火墙规则拉取接口
 * @FilePath: /special/application/api/controller/netfilter/FirewallRuleDownloadController.php
 */
namespace app\api\controller\netfilter;

use app\api\controller\BaseController;
use app\api\service\netfilter\FirewallRuleDownloadService;

class FirewallRuleDownloadController extends BaseController
{
    /**
     * @name: 规则下载
     * @Param: 
     * @Description: 客户端规则被更改|服务端下发规则|服务端更改防火墙配置|接管防火墙后开始学习|开关防火墙日志 拉取规则 
     * @Author: foo
     * @Date: 2020-11-17 15:05:36
     */
    public function download () 
    {
        $input = $this->filterInput();
        $this->validate($input, 'FirewallRule.rule_download');
        
        $FirewallRuleDownloadService = new FirewallRuleDownloadService($input['hostkey']);
        $data = $FirewallRuleDownloadService->download();
        //修改回调状态
        $this->setCallBackStatus(false);
        
        return $this->jsonOutPut($data);
    }
}